package com.metal.gear.certification.entity.dto;

import com.metal.gear.certification.entity.po.SysUser;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.beans.BeanUtils;

@Data
@Schema(name ="用户修改密码")
public class UserChangePasswordDto {
    @Schema(name ="userId")
    String id;
    @Schema(name ="用户账号")
    String username ;
    @Schema(name ="旧密码")
    String oldPassword ;
    @Schema(name ="新密码")
    String newPassword ;
    @Schema(name ="确认新密码")
    String confirmPassword;

    public static SysUser translateTo(UserChangePasswordDto saveDto){
        SysUser sysUser = new SysUser();
        BeanUtils.copyProperties(saveDto,sysUser);
        return sysUser;
    }

}
